﻿<Window x:Class="YLClient.Froms.Searcher"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="查询"  ResizeMode="NoResize" 
        WindowStartupLocation="CenterScreen" 
        xmlns:my="clr-namespace:YLClient.UserControls" 
        ShowInTaskbar="False" WindowStyle="ToolWindow" 
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        d:DesignHeight="269" d:DesignWidth="405" SizeToContent="WidthAndHeight">
    <Window.Resources>
        <Style x:Key="{x:Type ListBoxItem}" x:Name="lstStyle" TargetType="ListBoxItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width=".3*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Label  Grid.Column="0"
                                Name="lblParamter" Content="{Binding mMemo}"/>
                            <TextBox Grid.Column="1"
                                 MinWidth="100"
                                     Text="{Binding mValue}"
                                    ></TextBox>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="3*"/>
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">模板名称：</Label>
        <ComboBox Grid.Row="0" Grid.Column="1" Name="cmbTemplateName" 
                  SelectionChanged="cmbTemplateName_SelectionChanged"/>
        <Label Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center">查找距离最近：</Label>
        <ComboBox Grid.Row="1" Grid.Column="1" SelectedIndex="0"
                  Name="cmbPreDate"
                  >
            <ComboBoxItem Content="一个月" />
            <ComboBoxItem Content="两个月" />
            <ComboBoxItem Content="半年" />
            <ComboBoxItem Content="全部" />
        </ComboBox>
        <Label Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">
            主要参数：
        </Label>
        <ListBox  Grid.Row="2" Grid.Column="1"
                  Name="lstParamters"
                  ItemsSource="{Binding}"
                  >
        </ListBox>
        <Button
            Grid.Row="3"
            Grid.ColumnSpan="2"
            Name="btnSearch" 
            Content="查找" Height="47" Width="97"
                VerticalAlignment="Bottom" 
                 Click="btnSearch_Click" Padding="1,10" />
    </Grid>
</Window>
